//
//	MHCircleInfo.m
//
//	Create by 正荣 许 on 13/4/2018
//	Copyright © 2018. All rights reserved.
//	Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport



#import "MHCircleInfo.h"

NSString *const kMHCircleInfoAttrId = @"attrId";
NSString *const kMHCircleInfoAutoId = @"autoId";
NSString *const kMHCircleInfoCategory = @"category";
NSString *const kMHCircleInfoCircleCode = @"circleCode";
NSString *const kMHCircleInfoCoverUrl = @"coverUrl";
NSString *const kMHCircleInfoFullCoverUrl = @"fullCoverUrl";
NSString *const kMHCircleInfoIntro = @"intro";
NSString *const kMHCircleInfoLimitType = @"limitType";
NSString *const kMHCircleInfoOwnerUid = @"ownerUid";
NSString *const kMHCircleInfoPayType = @"payType";
NSString *const kMHCircleInfoPrice = @"price";
NSString *const kMHCircleInfoTitle = @"title";


@interface MHCircleInfo ()

@end
@implementation MHCircleInfo

-(BOOL)currentUserIsOwner
{
    return MHCurretUserId() == self.ownerUid;
}

-(BOOL) canPublish
{
    if (self.publishAuth == MHCirclePublishPermissionAll) {
        return true;
    }else if (self.publishAuth == MHCirclePublishPermissionOwner)
    {
        return self.identType == MHCircleIdentityTypeOwner;
        
    }else 
    {
        return self.identType == MHCircleIdentityTypeManager  || self.identType == MHCirclePublishPermissionOwner;
    }
}

-(NSString *) fetchShowLocation
{
    return  self.location.isShowLocation ? self.location.areaName: @"所在位置";
}
@end
